home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
3420A.ZIP
/
TW150L.ZIP
/
TSDWIN.CH
< prev
next >
Wrap
Text File
|
1992-05-06
|
15KB
|
362 lines
//------------------------------------------------------------------------
//
// TSDWIN.CH
//
// Header File for Use with TSDWIN.LIB
// Clipper 5.0 Window Library
//
// Copyright (C) 1992 Trilateral Systems Development Ltd.
// All Rights Reserved * Version 1.50 * Release Date: 01-25-92
//
// 18 Bond St. South
// Dundas, ON, Canada
// L9H 3H1
// 416-628-5086
//
//------------------------------------------------------------------------
#define TSD_HSEP "═╤═"
#define TSD_CSEP " │ "
#define TSD_FSEP "═╧═"
#define RSHIFT 01 // 1 0x0001
#define LSHIFT 02 // 2 0x0002
#define CTRL 03 // 4 0x0004
#define ALT 04 // 8 0x0008
#define SCROLLSTAT 05 // 16 0x0010
#define NUMLOCKSTAT 06 // 32 0x0020
#define CAPLOCKSTAT 07 // 64 0x0040
#define INSERTSTAT 08 // 128 0x0080
#define CTRLNUMLKSTAT 09 // 2048 0x0800
#define SCROLLOCK 10 // 4096 0x1000
#define NUMLOCK 11 // 8192 0x2000
#define CAPLOCK 12 // 16384 0x4000
#define INSERT 13 // 32768 0x8000
#define TRUE .T.
#define YES .T.
#define FALSE .F.
#define NO .F.
#define MACOMP(cexpr) &("{||" + cexpr + "}")
#ifdef DEBUG
#define ASSERT(expl, func) IIF(expl, "", func(procline()))
#else
#define ASSERT(expl, func)
#endif
#define LOG10( num ) LOG( num ) / LOG( 10 )
#define ISPUNCT( mVar ) ( mVar >= 43 .AND. mVar <= 47 )
//------------------------------------------------------------------------
// Translates
//------------------------------------------------------------------------
#translate STRINT(<x>) => LTRIM(STR(INT(<x>)))
#translate STRNUM(<x>) => LTRIM(STR(<x>))
#translate ISNIL( <v1> ) => ( <v1> == NIL )
#translate ISARR( <v1> ) => ( VALTYPE(<v1>) == "A" )
#translate ISBLK( <v1> ) => ( VALTYPE(<v1>) == "B" )
#translate ISCHAR( <v1> ) => ( VALTYPE(<v1>) == "C" )
#translate ISDATE( <v1> ) => ( VALTYPE(<v1>) == "D" )
#translate ISLOGI( <v1> ) => ( VALTYPE(<v1>) == "L" )
#translate ISMEMO( <v1> ) => ( VALTYPE(<v1>) == "M" )
#translate ISNUM( <v1> ) => ( VALTYPE(<v1>) == "N" )
#translate ISOBJ( <v1> ) => ( VALTYPE(<v1>) == "O" )
//------------------------------------------------------------------------
// Commands
//------------------------------------------------------------------------
#command ASHRINK( <array>, <size> ) ;
=> ;
ASIZE( <array>, IIF( <size> == NIL, LEN( <array> ) - 1, <size> ))
#command AEXPAND( <array>, <number> ) ;
=> ;
ASIZE( <array>, IIF( <number> == NIL, 1, <number> ))
#command REPEAT => DO WHILE .T.
#command UNTIL <lexp> => IF (<lexp>); EXIT; END; END
#command DEFAULT <p> TO <val> [,<pn> TO <valn>] ;
=> ;
<p> := IIF(<p> == NIL, <val>, <p>) ;
[;<pn> := IIF(<pn> == NIL, <valn>, <pn>)]
//------------------------------------------------------------------------
// Window Constants
//------------------------------------------------------------------------
#define WINTOP _twTop()
#define WINLEFT _twLeft()
#define WINBOTTOM _twBottom()
#define WINRIGHT _twRight()
#define WINLENGTH _twBottom()-_twTop()+1
#define WINWIDTH _twRight()-_twLeft()+1
#define WINHANDLE _twHandle()
#define WINSHADOW _twShadow()
#define WINTHICK _twShTh()
#define WINSTRUCT _twStructure()
#define WINTITLE _twTitle()
#define WINCOLOR _twColor()
#define WINFCOLOR _twFcolor()
#define WINFRAME _twFrame()
#define GETSTACK _twArray()
#define EXPLODEON twExplode( .T. )
#define EXPLODEOFF twExplode( .F. )
//------------------------------------------------------------------------
// Scroll Bar Constants
//------------------------------------------------------------------------
#define SB_ROWTOP 1
#define SB_COLTOP 2
#define SB_ROWBOTTOM 3
#define SB_COLBOTTOM 4
#define SB_COLOR 5
#define SB_POSITION 6
#define SB_DIRECTION 7
#define SB_MOUSEID 8
#define SB_ELEMENTS 8 // The number of elements defining a scroll bar
// data structure
// The Up and Down arrows, highlight and background char's for the thumb tab
#define SB_UPARROW CHR( 24 )
#define SB_DNARROW CHR( 25 )
#define SB_LEFTARROW CHR( 27 )
#define SB_RIGHTARROW CHR( 26 )
#define SB_HIGHLIGHT CHR( 219 )
#define SB_BACKGROUND CHR( 176 )
// Directions for scroll bars
#define SB_HORIZONTAL 1
#define SB_VERTICAL 2
#define MHIDE IIF( lOKMouse, _twM2(), .T. )
#define MSHOW IIF( lOKMouse, _twM1(), .T. )
#define MOKSHOW IIF(( lOKMouse := twOKMouse() ), _twM1(), .T. )
//------------------------------------------------------------------------
// Window Commands
//------------------------------------------------------------------------
#command WINDOW ;
=> ;
twOpen()
#command WINDOW TO <whandle>;
=> ;
<whandle> := twOpen()
#command WINDOW AT [<top>], [<left>], [<bottom>], [<right>] ;
[COLOR <mcolor>] ;
[SHADOW <mshadow>] ;
[FRAME <mframe>] ;
[FILL <mfill>] ;
[FCOLOR <mfcolor>] ;
[TITLE <mtitle>] ;
=> ;
twOpen( <top>, <left>, <bottom>, <right>, <mcolor>, <mshadow>, ;
<mframe>, <mfill>, <mfcolor>, <mtitle> )
#command WINDOW TO <whandle> AT [<top>], [<left>], [<bottom>], [<right>] ;
[COLOR <mcolor>] ;
[SHADOW <mshadow>] ;
[FRAME <mframe>] ;
[FILL <mfill>] ;
[FCOLOR <mfcolor>] ;
[TITLE <mtitle>] ;
=> ;
<whandle> := twOpen( <top>, <left>, <bottom>, <right>, <mcolor>, ;
<mshadow>, <mframe>, <mfill>, <mfcolor>, <mtitle> )
#xcommand WINHEADER <*title*> ;
=>;
twTitle( #<title> )
#xcommand WINFOOTER <*title*> ;
=>;
twTitle( #<title>,, "B", "C" )
#xcommand WINBORDER [FRAME <frame>] [COLOR <color>];
=>;
twFrame( <frame>, <color> )
//------------------------------------------------------------------------
// Menu and SAY.. GET.. Commands
//------------------------------------------------------------------------
#command @ <row>, <col> WSAY <cexpr> [COLOR <color>] [PICTURE <picture>];
=> ;
twSay( <row>, <col>, <cexpr>, <color>, <picture> )
#command @ <row>, <col> WPROMPT <prompt> [MESSAGE <msg>] [COLOR <color>] ;
[WHEN <when>] [ACTION <action>];
=>;
IIF( aMenu == NIL, aMenu := {}, NIL ) ;
;AADD( aMenu, { twRow( <row> ), twCol( <col> ), <prompt>, ;
<msg>, <color>, <{when}>, <{action}> })
#command WMENU TO <v> ;
=> <v> := twMenuTo( {|_1| if(PCount() == 0, <v>, <v> := _1)}, #<v>, aMenu );
;aMenu := {} ;
//------------------------------------------------------------------------
// Message System Commands
//------------------------------------------------------------------------
#command INFORM <message> [HEADER <header>] [WAIT <wait>] ;
[TOP <top>] [LEFT <left>] ;
[SHADOW <mshadow>] [FRAME <mframe>] ;
=> ;
twInfo( <message>, <header>, <wait>, <top>, <left>, ;
<mshadow>, <mframe> )
#command INQUIRE <message> TO <getvar> [HEADER <header>] ;
[TOP <top>] [LEFT <left>] ;
[SHADOW <mshadow>] [FRAME <mframe>] ;
=> ;
<getvar> := twInquire( <message>, <header>, <getvar>, <top>, <left>, ;
<mshadow>, <mframe> )
#command WARNING <message> [HEADER <header>] [WAIT <wait>] ;
[TOP <top>] [LEFT <left>] ;
[SHADOW <mshadow>] [FRAME <mframe>] ;
=> ;
twWarn( <message>, <header>, <wait>, <top>, <left>, ;
<mshadow>, <mframe> )
#command MSGTEXT <message> [HEADER <header>] [WAIT <wait>] ;
[<top>], [<left>], [<bottom>], [<right>] ;
[COLOR <color>] [SHADOW <mshadow>] [FRAME <mframe>] ;
=> ;
twTextMsg( <message>, <header>, <wait>, <top>, <left>, ;
<bottom>, <right>, ;
<color>, <mshadow>, <mframe> )
//------------------------------------------------------------------------
// Alert System Commands
//------------------------------------------------------------------------
#command BUTTONBOX [<orient:H,V>] TO <mvar> [MESSAGE <message>] [TITLE <title>] ;
[WITH <nobuttons> BUTTONS] [CHOICES <choices>] [START <start>] ;
AT [<top>], [<left>], [<bottom>], [<right>] ;
[SHADOW <shadow>] [FRAME <frame>] [EXITKEY <exitkey>] ;
[ACTIONKEYS <actionkeys>] ;
=> ;
<mvar> := twButtonBox( <"orient">, <message>, <title>, <nobuttons>, ;
<choices>, <start>, <top>, <left>, <bottom>, <right>, ;
<shadow>, <frame>, <exitkey>, <actionkeys> )
#command CHECKBOX [<orient:H,V>] TO <mvar> [MESSAGE <message>] [TITLE <title>] ;
[WITH <nobuttons> BUTTONS] [CHOICES <choices>] [START <start>] ;
AT [<top>], [<left>], [<bottom>], [<right>] ;
[SHADOW <shadow>] [FRAME <frame>] [EXITKEY <exitkey>] ;
[ACTIONKEYS <actionkeys>] ;
=> ;
<mvar> := twCheckBox( <"orient">, <message>, <title>, <nobuttons>, ;
<choices>, <start>, <top>, <left>, <bottom>, <right>, ;
<shadow>, <frame>, <exitkey>, <actionkeys> )
#command RADIOBOX [<orient:H,V>] TO <mvar> [MESSAGE <message>] [TITLE <title>] ;
[WITH <nobuttons> BUTTONS] [CHOICES <choices>] [START <start>] ;
AT [<top>], [<left>], [<bottom>], [<right>] ;
[SHADOW <shadow>] [FRAME <frame>] [EXITKEY <exitkey>] ;
[ACTIONKEYS <actionkeys>] ;
=> ;
<mvar> := twRadioBox( <"orient">, <message>, <title>, <nobuttons>, ;
<choices>, <start>, <top>, <left>, <bottom>, <right>, ;
<shadow>, <frame>, <exitkey>, <actionkeys> )
//------------------------------------------------------------------------
// Browse System Commands
//------------------------------------------------------------------------
#command BROWSEARRAY <array> AT [<top>], [<left>], [<bottom>], [<right>] ;
[TITLE <title>] [HEADERS <headers>] [FOOTERS <footers>] ;
[EDIT <edit>] [ACTIONKEYS <actionkeys>] [COLOR <color>] ;
[SHADOW <shadow>] [FRAME <frame>] [FRAMECOLOR <framecolor>] ;
[AUTOLITE <autolite>] [FREEZE <freeze>] ;
=> ;
twArBrowse( <top>, <left>, <bottom>, <right>, ;
<array> , <title>, <headers>, <footers>, ;
<edit>, <actionkeys>, <color>, <shadow>, <frame>, <framecolor>, ;
<autolite>, <freeze> )
#command BROWSEARRAY <array> TO <mvar> AT [<top>], [<left>], ;
[<bottom>], [<right>] ;
[TITLE <title>] [HEADERS <headers>] [FOOTERS <footers>] ;
[EDIT <edit>] [ACTIONKEYS <actionkeys>] [COLOR <color>] ;
[SHADOW <shadow>] [FRAME <frame>] [FRAMECOLOR <framecolor>] ;
[AUTOLITE <autolite>] [FREEZE <freeze>] ;
=> ;
<mvar> := twArBrowse( <top>, <left>, <bottom>, <right>, ;
<array> , <title>, <headers>, <footers>, ;
<edit>, <actionkeys>, <color>, <shadow>, ;
<frame>, <framecolor>, ;
<autolite>, <freeze> )
#command BROWSEDBF AT [<top>], [<left>], [<bottom>], [<right>] ;
[COLUMNS <columns>] [TITLE <title>] [FOOTERS <footers>] ;
[TOPBLOCK <topblock>] [BOTTOMBLOCK <bottomblock>] ;
[SCOPEBLOCK <scopeblock>] [EDIT <edit>] ;
[ACTIONKEYS <actionkeys>] [COLOR <color>] [SHADOW <shadow>] ;
[FRAME <frame>] [FRAMECOLOR <framecolor>] [SCROLLBAR <scrollbar>] ;
[MESSAGES <messages>] [AUTOLITE <autolite>] [FREEZE <freeze>] ;
[STABILIZE <stabilize>] ;
=> ;
twDBrowse( <top>, <left>, <bottom>, <right>, ;
<columns>, <title>, <footers>, <topblock>, ;
<bottomblock>, <scopeblock>, <edit>, <actionkeys>, ;
<color>, <shadow>, <frame>, <framecolor>, <scrollbar>, ;
<messages>, <autolite>, <freeze>, <stabilize> )
#command BROWSEDBF TO <mvar> AT [<top>], [<left>], [<bottom>], [<right>] ;
[COLUMNS <columns>] [TITLE <title>] [FOOTERS <footers>] ;
[TOPBLOCK <topblock>] [BOTTOMBLOCK <bottomblock>] ;
[SCOPEBLOCK <scopeblock>] [EDIT <edit>] ;
[ACTIONKEYS <actionkeys>] [COLOR <color>] [SHADOW <shadow>] ;
[FRAME <frame>] [FRAMECOLOR <framecolor>] [SCROLLBAR <scrollbar>] ;
[MESSAGES <messages>] [AUTOLTE <autolte>] [FREEZE <freeze>] ;
[STABILIZE <stabilize>] ;
=> ;
<mvar> := twDBrowse( <top>, <left>, <bottom>, <right>, ;
<columns>, <title>, <footers>, <topblock>, ;
<bottomblock>, <scopeblock>, <edit>, <actionkeys>, ;
<color>, <shadow>, <frame>, <framecolor>, <.scrollbar.>, ;
<.messages.>, <.autolte.>, <freeze>, <.stabilize.> )
//------------------------------------------------------------------------
// Calculator Commands
//------------------------------------------------------------------------
#command CALCINIT AT <top>, <left> [COLOR <color>] [SHADOW <shadow>] ;
[FRAME <frame>] [PASTE <paste>] ;
=> ;
twCalcInit( <top>, <left>, <color>, <shadow>, <frame>, <.paste.> )
#command CALCINIT ;
=> ;
twCalcInit()
#command CALCULATOR TO <nkey> ;
=> ;
SET KEY <nkey> TO twCallCalc()
#command RESET CALCULATOR ;
=> ;
ERASE *.CLC
//------------------------------------------------------------------------
// Miscellaneous Commands and Translates
//------------------------------------------------------------------------
#translate MAKEWSHAD( <r1>, <c1>, <r2>, <c2> ) ;
=> ;
RESTSCREEN( <r1>, <c1>, <r2>, <c2>, _twAttrChg(;
SAVESCREEN( <r1>, <c1>, <r2>, <c2> ), IIF( ISCOLOR(), 8, 7 )))
#command GETSTRUCT ;
=> ;
twGetStruct(@sT,@sL,@sB,@sR,@wT,@wL,@wB,@wR,@tShadow,@tScr,;
@uScr,@tlength,@twidth,@tThick,@sh13,@sh17,@sh79,@sh39)
#command SETSTRUCT ;
=> ;
twSetStruct(wT,wL,wB,wR,sT,sL,sB,sR,uScr)